<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  
   <base href="<%=basePath%>">
    <title>My JSP 'index.jsp' starting page</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
  <link rel="stylesheet" href="css/demos.css" type="text/css"></link>
  <link rel="stylesheet" href="css/jquery.ui.all.css" type="text/css"></link>
  <link rel="stylesheet" href="css/jquery.ui.theme.css" type="text/css"></link>
  <link rel="stylesheet" href="css/jquery.ui.base.css" type="text/css"></link>
  <script type="text/javascript" src="javascript/jquery-1.4a2.min.js"></script>
  </head>
  
  <body>
  
  	<script language="JavaScript" type="text/JavaScript">
    
    function callAjax(){
    	var url = "<%=basePath%>user.do?m=checkname";
    	
    	$("#checkname").load( url,{name:$("#name").val()},function(responseText,textStauts,XMLHttpRequest){
    	$("#checkname").html(responseText);
    	})
    }
    
   </script>

    <form action="<%=basePath%>user.do?m=register" method="post">
    	用户名:<input type="text" name="name" id="name" onblur="callAjax()"/>
    	<label id ="checkname"></label>
    	密码:<input type="text" name="password"/> 
    	<input type = "hidden" name="m" value="register"/>
    	<input type="submit" value="提交"/>
   </form>
    
    <br>
     
  </body>

</html>
